﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using DataService;

public partial class Account_changePassword : BasePage
{
    private UserService service = new UserService();
    protected void Page_Load(object sender, EventArgs e)
    {
        lblNameUser.Text = UserLogin.Username;
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (UserLogin.Password != txtCurrentPassword.Text.Trim())
        {
            lblWrongPass.Visible = true;
        }
        else
        {
            service.ChangePasswordByUserName(UserLogin.Username, txtRePassword.Text.Trim());
            lblWrongPass.Visible = false;
            Response.Redirect("Default.aspx");
        }
    }
}